FROM ubuntu:15.04
MAINTAINER kaibb www@kaibb.com

#install packages
RUN apt-get update
RUN apt-get install -y openssh-server vim rsync iproute tcpdump gcc perl automake autoconf libtool make libpcre3-dev gdb cgdb iputils-ping curl

#passwordless ssh
RUN mkdir /var/run/sshd; \
	echo 'root:123456' | chpasswd; \
	sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config; \
	ssh-keygen -q -N "" -t rsa -f /root/.ssh/id_rsa; \
	cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys; \

# SSH login fix. Otherwise user is kicked off after login
	sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd

 CMD ["/usr/sbin/sshd", "-D"]